package motionsApp.server;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Motion {
	
	public Motion(){
		labelKeys = new HashSet<Key>();
	}
	
	public Motion(String name) {
		this();
		this.name = name;
	}
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Set<Key> labelKeys;
	
	@Persistent
    private String name;
	
	public String getName() {
		return name;
	}
	
	public void setLabels(Collection<Key> labelKeys) {
		this.labelKeys.addAll(labelKeys);		
	}
	
	public Set<Key> getLabels() {
		return labelKeys;		
	}
	
	
}
